import pymysql

conn = pymysql.connect(host="localhost",port=3306,user="root",
password="zxc123!!",database="test_7_11",charset="utf8")

cursor = conn.cursor()

cursor.execute("select version()")
res = cursor.fetchone()
print("结果为:")
print(res[0])
print(res)

cursor.close()
conn.close()
